package com.xxx.ware.ware_manage_sys.bean.enums;

import java.util.HashMap;
import java.util.Map;

public enum RoleEnum {
    ADMIN("1", "管理员"),
    SUPER_ADMIN("2", "超级管理员"),
    USER("3", "用户");
    private String roleCode;
    private String roleText;
    private static Map<String, String> adminMap = new HashMap<>();

    static {
        RoleEnum[] values = RoleEnum.values();
        for (RoleEnum value : values) {
            adminMap.put(value.roleCode, value.roleText);
        }
    }

    RoleEnum(String roleCode, String roleText) {
        this.roleCode = roleCode;
        this.roleText = roleText;
    }

    public static String getAdminRole(String code){
        return adminMap.get(code);
    }

}
